<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/include/common.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<script src="javaScript/user.js" charset='UTF-8'></script>

<table align="center">
	<!-- 로그인 -->
	<c:if test="${loginUser != null}">
		<!-- 사용자 이름 -->
		<tr>
			<td align="center">
				<b>${loginUser.name}</b>님 반갑습니다.
			</td>
		</tr>
		<!-- 장바구니 -->
		<tr>
			<td align="center">
				<input type="button" onclick="window.location='<c:url value='/viewCartList.do?userId=${loginUser.userId}'/>'" value="장바구니보기" />
			</td>
		</tr>
		<!-- 주문내역 -->
		<tr>
			<td align="center">
				<input type="button" onclick="alert('주문내역 보기 개발중 입니다.')" value="주문내역보기" />
			</td>
		</tr>
		<!-- 로그아웃 -->
		<tr>
			<td align="center">
				<input type="button" onclick="window.location='<c:url value='/logout.do'/>'" value="로그아웃" />
			</td>
		</tr>
	</c:if>
	<!-- 비로그인 -->
	<c:if test="${loginUser == null}">
		<tr>
			<td align="center" width=300>
				<form id='loginForm' action='<c:url value='/login.do'/>' method='post'>
					<input type="text" id="userId" name="userId" placeholder="아이디" value="nsbosu@me.com">
					<input type="password" id="password" name="password" placeholder="비밀번호" value="123">
				</form>
			</td>
		</tr>
		<tr>
			<td align="center">
				<input type="button" value="로그인" onclick="login(document.getElementById('loginForm'))" />
				<input type="button" onclick="window.location='<c:url value='/showSignUp.do'/>'" value="회원가입" />
			</td>
		</tr>
	</c:if>
</table>